package com.ego.controller;

import com.ego.service.PortalService;
import com.ego.utils.JsonUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PortalController {

    @Autowired
    private PortalService portalService;

    @RequestMapping("/")
    public String toIndex(Model model) {
        model.addAttribute("ad1", JsonUtils.objectToJson(portalService.selectByPage()));
        return "index";
    }

}
